package com.stox.core.ui.swing.widget;

import java.awt.BorderLayout;
import java.awt.event.KeyAdapter;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseMotionAdapter;

import javax.swing.JLabel;

import com.stox.core.ui.swing.wrapper.JPanel;
import com.stox.resources.image.ImageIconLoader;

public class GlassPane extends JPanel {
	private static final long serialVersionUID = 7150101009613012548L;

	private JLabel padding = new JLabel();
	
	@SuppressWarnings("deprecation")
	public GlassPane() {
		setOpaque(false);
		padding.setIcon(ImageIconLoader.loadImageIcon("arrow-loading-icon.gif", 50, 50));
		add(padding, BorderLayout.CENTER);
		 addMouseListener(new MouseAdapter() {});
		 addMouseMotionListener(new MouseMotionAdapter() {});
		 addKeyListener(new KeyAdapter() {});
		 padding.setNextFocusableComponent(padding); 
	}
	
	@Override
	public void setVisible(boolean aFlag) {
		super.setVisible(aFlag);
		padding.requestFocus();
	}
	
}
